#include "common.h"
typedef struct
{
	char time[100];
	char from[100];
	char to[100];
	char subject[300];
	char attach[100];
}t_email_head;

int pop_login(SOCKET fd, char * account, char *pass);
int get_stat(SOCKET fd, char * buf, int size);

int dele(SOCKET fd,int id);

int get_list(SOCKET fd, char * buf, int size);

int get_amount(SOCKET fd);
int parse_head(char * data, t_email_head * h);
int parse_content(char * data, char * content);

int get_top(SOCKET fd, int num, int line, char * buf, int size);

int email_save(char * data, char * file);

int get_retr(SOCKET fd, int id, char * buffer, int size);


int email_save_attachment(char * data, int id);